import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int count = 0;
        int n = sc.nextInt();
        while (n > 0) {
            if (method(n)) {
                count++;
            }
            n--;
        }
        System.out.println(count);
        sc.close();
    }

    public static boolean method(int num) {
        int index = 1;
        while (num > 0) {
            int x = num % 10;
            if (index % 2 == 0) {
                //偶数位
                if (x % 2 != 0) {
                    return false;
                }
            } else {
                //奇数位
                if (x % 2 == 0) {
                    return false;
                }
            }
            index++;
            num /= 10;
        }
        return true;
    }
}